import loadable from '@loadable/component';
import { RouteObject } from 'src/interface/route';
import Layout from 'src/layout';

const DepManage = loadable(() => import('src/pages/system/deps'));
const UserManage = loadable(() => import('src/pages/system/users'));
const RoleManage = loadable(() => import('src/pages/system/roles'));
const MenuManage = loadable(() => import('src/pages/system/menus'));

const dashboardRoute: RouteObject[] = [
  {
    path: '/system',
    element: <Layout />,
    name: '系统管理',
    data: {
      locale: 'menu.system',
    },
    children: [
      {
        path: 'users',
        name: '用户管理',
        data: {
          locale: 'menu.user',
        },
        element: <UserManage />,
      },
      {
        path: 'roles',
        name: '角色管理',
        data: {
          locale: 'menu.role',
        },
        element: <RoleManage />,
      },
      {
        path: 'menus',
        name: '菜单管理',
        data: {
          locale: 'menu.menu',
        },
        element: <MenuManage />,
      },
      {
        path: 'deps',
        name: '部门管理',
        data: {
          locale: 'menu.dep',
        },
        element: <DepManage />,
      },
    ],
  },
];

export default dashboardRoute;
